/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author labib
 */
import Utility.SessionFactoryUtil;
import java.util.Iterator;
import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import xmlMapping.Theme;
public class test {
   
    public static void main(String[] args) {
           Transaction tx = null;
            Session session=SessionFactoryUtil.getSessionFactory().getCurrentSession();
            tx=session.beginTransaction();
            Query qur= session.createQuery("from Theme ");
	    Iterator it=qur.list().iterator();
	    while(it.hasNext())
	{
		 Theme hib=(Theme)it.next();
                 System.out.println(hib.getThemeId() +"name is "+ hib.getName());
	}
            tx.commit();
    }
}
